home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Pascal / Games / Glider 3.14 / source / Glider parts ƒ / A-LogoWindo.Pas next >
Encoding:
Pascal/Delphi Source File  |  1991-04-29  |  1.8 KB  |  83 lines  |  [TEXT/PJMM]

  1. unit LogoWindo;
  2.  
  3. interface
  4.  
  5.     procedure Init_LogoWindo;
  6.     procedure Close_LogoWindo;
  7.     procedure Open_LogoWindo;
  8.     procedure Update_LogoWindo;
  9.  
  10. implementation
  11.  
  12.     var
  13.         logoWindo: WindowPtr;
  14.         tempRect: Rect;
  15.         Pic_Handle: PicHandle;
  16.  
  17. {=================================}
  18.  
  19.     procedure Init_LogoWindo;
  20.     begin
  21.         logoWindo := nil;
  22.     end;
  23.  
  24. {=================================}
  25.  
  26.     procedure Close_LogoWindo;
  27.     begin
  28.         if (logoWindo <> nil) then
  29.             begin
  30.                 DisposeWindow(logoWindo);
  31.                 logoWindo := nil;
  32.             end;
  33.     end;
  34.  
  35. {=================================}
  36.  
  37.     procedure UpDate_LogoWindo;
  38.         var
  39.             SavePort: WindowPtr;
  40.     begin
  41.         if (logoWindo <> nil) then
  42.             begin
  43.                 GetPort(SavePort);
  44.                 SetPort(logoWindo);
  45.                 Pic_Handle := GetPicture(1999);
  46.                 SetRect(tempRect, 0, 0, 321, 308);
  47.                 if (Pic_Handle <> nil) then
  48.                     begin
  49.                         ClipRect(tempRect);
  50.                         HLock(Handle(Pic_Handle));
  51.                         tempRect.Right := tempRect.Left + (Pic_Handle^^.picFrame.Right - Pic_Handle^^.picFrame.Left);
  52.                         tempRect.Bottom := tempRect.Top + (Pic_Handle^^.picFrame.Bottom - Pic_Handle^^.picFrame.Top);
  53.                         HUnLock(Handle(Pic_Handle));
  54.                     end;
  55.                 if (Pic_Handle <> nil) then
  56.                     DrawPicture(Pic_Handle, tempRect);
  57.                 ReleaseResource(Handle(Pic_Handle));
  58.                 SetRect(tempRect, 0, 0, 1023, 1023);
  59.                 ClipRect(tempRect);
  60.                 SetPort(SavePort);
  61.             end;
  62.     end;
  63.  
  64. {=================================}
  65.  
  66.     procedure Open_LogoWindo;
  67.     begin
  68.         if (logoWindo = nil) then
  69.             begin
  70.                 logoWindo := GetNewWindow(1999, nil, Pointer(-1));
  71.                 MoveWindow(logoWindo, (screenBits.bounds.right - 321) div 2, (screenBits.bounds.bottom - 308) div 2, FALSE);
  72.                 ShowWindow(logoWindo);
  73.                 SelectWindow(logoWindo);
  74.                 SetPort(logoWindo);
  75.                 UpDate_LogoWindo;
  76.             end
  77.         else
  78.             SelectWindow(logoWindo);
  79.     end;
  80.  
  81. {=================================}
  82.  
  83. end.                                    {End of unit}